﻿using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore;
using Microsoft.Extensions.DependencyInjection;
using HRX.PayCenter.Infrastructure.Data;
using System;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Configuration;

namespace HRX.PayCenter.Web
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var host = CreateWebHostBuilder(args)
                        .Build();

            host.Run();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                    .ConfigureAppConfiguration(
                        c => c
                        .AddJsonFile("appsettings.json", true, true))
                .UseUrls("http://0.0.0.0:80")
                .ConfigureLogging(
                    c=>c.ClearProviders()
                    .SetMinimumLevel(LogLevel.Trace)
                )
                .UseStartup<Startup>()
                ;
    }
}
